Skip to content

chore: use Rolldown bundle analyzer instead of rollup-plugin-visualizer - #343

Open
stipsan wants to merge 1 commit into
mainfrom
cursor/rolldown-bundle-analyzer-6e6c
Open

chore: use Rolldown bundle analyzer instead of rollup-plugin-visualizer#343
stipsan wants to merge 1 commit into
mainfrom
cursor/rolldown-bundle-analyzer-6e6c

Conversation

@stipsan

@stipsan stipsan commented Aug 18, 2026

Copy link
Copy Markdown
Member

Replace rollup-plugin-visualizer with Rolldown’s built-in analyzer, and use @sanity/tsdown-config’s first-class bundleAnalyzer option for the published package.

Demo (vite.config.demo.ts)

  • bundleAnalyzerPlugin from rolldown/experimental instead of the Rollup visualizer
  • pnpm build:demo emits demo/dist/analyze-data.json

Library (tsdown.config.ts)

  • bundleAnalyzer: process.env['ENABLE_BUNDLE_ANALYZER'] === 'true' (markdown report when enabled)
  • pnpm analyze runs that opt-in build
  • !dist/analyze-data.md so the report cannot be published

Deps

  • @sanity/tsdown-config ^0.27.0 (adds bundleAnalyzer)
  • rolldown ~1.2.5 so Vite, tsdown, and the config share one BuiltinPlugin instance
  • vite ^8.2.2

Verified locally: library build, pnpm analyzedist/analyze-data.md, demo build → analyze-data.json, lint, type-check, and tests.

Open in Web Open in Cursor 

@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1cfb335

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@stipsan
stipsan marked this pull request as ready for review August 18, 2026 10:12
Swap the demo Vite build to rolldown/experimental bundleAnalyzerPlugin, and
gate the published-package report behind @sanity/tsdown-config's bundleAnalyzer
option (ENABLE_BUNDLE_ANALYZER=true).

Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/rolldown-bundle-analyzer-6e6c branch from 0d28358 to 1cfb335 Compare August 27, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants